//
// soft_state.h
//

#ifndef KITTY_SOFT_STATE_H
#define KITTY_SOFT_STATE_H

#include <map>
#include <ctime>
#include <string>
#include <boost/array.hpp>
#include <boost/thread.hpp>
#include <boost/shared_ptr.hpp>

namespace kitty {

enum peer_state
{
    peer_alive,
    peer_suspected,
    peer_dead
};

struct soft_state_entry
{
    boost::mutex   entry_mutex;
    time_t         local_time; // local timestamp
    std::string    ip;
    unsigned short port;
    time_t         peer_time;  // peer timestamp
    kitty::peer_state state;
};

typedef boost::shared_ptr<soft_state_entry> soft_state_entry_ptr;

typedef std::map<boost::array<unsigned char, 16>, soft_state_entry_ptr> soft_state;

}

#endif // KITTY_SOFT_STATE_H

